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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.t: E = None
        self.x: A = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.t: E = None
        self.x: A = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

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

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