class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: B = None
        self.p: C = None
        self.y: F = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

g.x = j
g.p = j
g.o = a
g.y = f
g.w = f
a.s = f
a.u = c
a.o = j
a.t = g
j.z = c
n.v = g
c.p = g
c.u = j
c.x = j
f.w = g
f.u = g
f.r = c
b.v = g
assert b.v.o.o.z.x.z.p.txt == "g"