class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.x: C = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

e = A("e")
j = B("j")
b = C("b")
n = D("n")
d = E("d")
f = F("f")
l = B("l")
h = E("h")
k = B("k")
c = C("c")

e.r = c
e.x = c
e.z = f
e.v = f
j.o = b
b.p = e
n.q = j
n.w = k
d.s = n
d.r = c
d.o = b
d.p = f
d.x = f
f.r = e
f.y = c
f.t = c
f.z = d
l.o = c
h.s = n
h.r = b
h.o = b
h.p = f
h.x = f
k.o = c
c.p = e
assert f.y.p.v.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.x: C = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

e = A("e")
j = B("j")
b = C("b")
n = D("n")
d = E("d")
f = F("f")
l = B("l")
h = E("h")
k = B("k")
c = C("c")

e.r = c
e.x = c
e.z = f
e.v = f
j.o = b
b.p = e
n.q = j
n.w = k
d.s = n
d.r = c
d.o = b
d.p = f
d.x = f
f.r = e
f.y = c
f.t = c
f.z = d
l.o = c
h.s = n
h.r = b
h.o = b
h.p = f
h.x = f
k.o = c
c.p = e
assert f.y.p.v.r.x.txt == "c"