class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.z: C = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: A = None
        self.w: C = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: C = None
        self.o: E = None
        self.x: A = None
        self.y: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.txt = txt

g = A("g")
d = B("d")
h = C("h")
j = D("j")
l = E("l")
c = F("c")
a = G("a")
i = A("i")
f = B("f")

g.y = l
g.p = l
g.z = h
g.t = i
g.w = a
d.r = i
d.p = i
d.w = h
d.q = j
d.y = f
h.q = a
j.q = i
j.p = g
l.v = h
l.t = h
c.p = a
c.r = h
c.v = h
c.o = l
c.x = i
c.y = g
a.t = i
a.z = h
i.y = l
i.p = l
i.z = h
i.t = g
i.w = a
f.r = g
f.p = g
f.w = h
f.q = j
f.y = d
assert l.t.q.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.z: C = None
        self.t: A = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: A = None
        self.w: C = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: C = None
        self.o: E = None
        self.x: A = None
        self.y: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.txt = txt

g = A("g")
d = B("d")
h = C("h")
j = D("j")
l = E("l")
c = F("c")
a = G("a")
i = A("i")
f = B("f")

g.y = l
g.p = l
g.z = h
g.t = i
g.w = a
d.r = i
d.p = i
d.w = h
d.q = j
d.y = f
h.q = a
j.q = i
j.p = g
l.v = h
l.t = h
c.p = a
c.r = h
c.v = h
c.o = l
c.x = i
c.y = g
a.t = i
a.z = h
i.y = l
i.p = l
i.z = h
i.t = g
i.w = a
f.r = g
f.p = g
f.w = h
f.q = j
f.y = d
assert l.t.q.t.z.txt == "h"