class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: G = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.o: D = None
        self.u: A = None
        self.q: E = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: B = None
        self.o: F = None
        self.u: D = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: F = None
        self.x: E = None
        self.txt = txt

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

d.y = b
d.u = l
d.o = h
f.s = h
f.v = h
f.q = h
f.y = h
f.o = b
f.p = b
f.u = d
a.q = b
a.u = b
a.z = f
a.o = k
a.t = c
b.v = l
h.r = k
k.s = c
l.p = h
l.x = h
l.q = k
i.q = b
i.u = b
i.z = f
i.o = k
i.t = c
c.p = h
c.x = h
c.q = k
assert l.x.r.s.q.s.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: G = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.o: D = None
        self.u: A = None
        self.q: E = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: B = None
        self.o: F = None
        self.u: D = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: F = None
        self.x: E = None
        self.txt = txt

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

d.y = b
d.u = l
d.o = h
f.s = h
f.v = h
f.q = h
f.y = h
f.o = b
f.p = b
f.u = d
a.q = b
a.u = b
a.z = f
a.o = k
a.t = c
b.v = l
h.r = k
k.s = c
l.p = h
l.x = h
l.q = k
i.q = b
i.u = b
i.z = f
i.o = k
i.t = c
c.p = h
c.x = h
c.q = k
assert l.x.r.s.q.s.x.r.txt == "k"