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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
k = C("k")
f = D("f")
d = E("d")
a = F("a")
b = G("b")
j = C("j")
m = A("m")
c = D("c")

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
k = C("k")
f = D("f")
d = E("d")
a = F("a")
b = G("b")
j = C("j")
m = A("m")
c = D("c")

g.v = c
g.x = d
g.w = d
g.y = a
g.p = b
g.q = l
l.q = a
k.o = l
k.y = d
f.z = l
f.p = g
d.o = a
d.q = b
a.t = j
b.s = d
b.q = a
j.o = l
j.y = d
m.v = f
m.x = d
m.w = d
m.y = a
m.p = b
m.q = l
c.z = l
c.p = g
assert k.o.q.t.o.txt == "l"