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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.u: E = None
        self.v: D = None
        self.r: E = None
        self.txt = txt

h = A("h")
g = B("g")
i = C("i")
k = D("k")
b = E("b")
c = F("c")
m = D("m")
a = C("a")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.u: E = None
        self.v: D = None
        self.r: E = None
        self.txt = txt

h = A("h")
g = B("g")
i = C("i")
k = D("k")
b = E("b")
c = F("c")
m = D("m")
a = C("a")

h.p = m
h.r = c
h.x = b
g.t = c
g.x = b
i.p = b
i.u = b
i.w = a
i.o = h
i.s = c
k.r = c
k.y = i
k.u = i
k.z = a
k.t = h
b.r = c
c.t = g
c.z = g
c.u = b
c.r = b
c.v = k
m.r = c
m.y = i
m.z = i
m.u = a
m.t = h
a.p = b
a.u = b
a.w = i
a.o = h
a.s = c
assert g.t.r.r.z.x.txt == "b"