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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.o: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.o: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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