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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: B = None
        self.p: B = None
        self.w: B = None
        self.r: F = None
        self.y: B = None
        self.txt = txt

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

h = A("h")
b = B("b")
k = C("k")
j = D("j")
d = E("d")
g = F("g")

h.x = g
h.v = d
h.z = k
h.u = k
h.p = j
b.r = h
b.y = j
b.o = k
k.x = b
k.p = b
k.t = d
k.r = d
k.o = h
k.u = g
j.t = k
d.u = j
d.s = b
d.p = b
d.w = b
d.y = b
d.r = g
g.v = h
g.w = h
assert g.w.u.r.u.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: E = None
        self.z: C = None
        self.p: D = None
        self.u: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: B = None
        self.p: B = None
        self.w: B = None
        self.r: F = None
        self.y: B = None
        self.txt = txt

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

h = A("h")
b = B("b")
k = C("k")
j = D("j")
d = E("d")
g = F("g")

h.x = g
h.v = d
h.z = k
h.u = k
h.p = j
b.r = h
b.y = j
b.o = k
k.x = b
k.p = b
k.t = d
k.r = d
k.o = h
k.u = g
j.t = k
d.u = j
d.s = b
d.p = b
d.w = b
d.y = b
d.r = g
g.v = h
g.w = h
assert g.w.u.r.u.t.p.txt == "b"