class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: C = None
        self.p: A = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.w: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.w: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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