class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.q: F = None
        self.z: B = None
        self.s: D = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: F = None
        self.q: B = None
        self.o: E = None
        self.s: B = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: F = None
        self.q: B = None
        self.o: E = None
        self.s: B = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: F = None
        self.x: D = None
        self.txt = txt

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

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

k.p = f
k.s = f
k.y = c
k.q = l
k.z = g
k.r = a
g.o = f
g.y = c
a.y = c
a.o = c
a.w = l
a.q = g
a.s = g
a.z = g
f.p = g
c.z = g
c.s = l
c.x = f
l.v = c
l.u = b
l.o = b
l.q = k
l.s = f
b.y = c
b.o = c
b.w = l
b.q = g
b.s = g
b.z = g
assert b.q.o.p.o.p.o.txt == "f"