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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: C = None
        self.t: B = None
        self.y: C = 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.v: B = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

l.q = a
l.r = j
l.o = k
l.x = g
g.z = l
h.o = c
h.q = k
h.u = f
h.p = l
a.u = l
a.r = h
a.y = h
a.t = g
c.r = j
j.v = g
j.y = a
j.u = i
i.o = f
i.q = k
i.u = c
i.p = l
f.r = j
m.v = g
m.y = a
m.u = i
k.r = j
assert j.y.r.q.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: F = None
        self.o: E = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: C = None
        self.t: B = None
        self.y: C = 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.v: B = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

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