class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.p: F = None
        self.s: F = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

g.v = b
g.o = j
g.p = m
g.s = m
g.r = c
f.s = a
f.r = a
i.q = g
i.y = g
i.p = f
a.t = g
a.r = j
l.p = b
m.r = c
m.z = b
m.o = l
j.t = g
j.r = a
b.q = g
b.y = g
b.p = f
c.r = m
c.z = i
c.o = l
assert a.t.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: D = None
        self.p: F = None
        self.s: F = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

g.v = b
g.o = j
g.p = m
g.s = m
g.r = c
f.s = a
f.r = a
i.q = g
i.y = g
i.p = f
a.t = g
a.r = j
l.p = b
m.r = c
m.z = b
m.o = l
j.t = g
j.r = a
b.q = g
b.y = g
b.p = f
c.r = m
c.z = i
c.o = l
assert a.t.p.o.txt == "l"