class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.v: F = None
        self.y: F = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.x: C = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.t: B = None
        self.z: F = None
        self.v: E = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.txt = txt

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

l.x = h
l.r = h
l.v = g
l.y = g
l.q = e
l.t = d
e.z = c
e.x = c
e.y = h
e.q = d
c.z = e
c.x = h
c.t = h
c.q = g
d.w = j
d.p = e
d.t = e
d.z = g
d.v = h
d.s = h
d.q = h
h.q = l
h.z = c
g.u = d
g.o = d
g.z = c
g.x = l
j.r = d
j.t = d
assert l.t.w.r.z.x.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.v: F = None
        self.y: F = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.x: C = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: E = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.t: B = None
        self.z: F = None
        self.v: E = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: C = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: D = None
        self.txt = txt

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

l.x = h
l.r = h
l.v = g
l.y = g
l.q = e
l.t = d
e.z = c
e.x = c
e.y = h
e.q = d
c.z = e
c.x = h
c.t = h
c.q = g
d.w = j
d.p = e
d.t = e
d.z = g
d.v = h
d.s = h
d.q = h
h.q = l
h.z = c
g.u = d
g.o = d
g.z = c
g.x = l
j.r = d
j.t = d
assert l.t.w.r.z.x.r.z.txt == "c"