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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.t: C = None
        self.u: A = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

c = A("c")
i = B("i")
j = C("j")
h = D("h")
n = E("n")
g = F("g")
f = B("f")

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.t: C = None
        self.u: A = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

c = A("c")
i = B("i")
j = C("j")
h = D("h")
n = E("n")
g = F("g")
f = B("f")

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